package com.treetao.union.db.mapper;

import org.apache.ibatis.annotations.One;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.treetao.union.db.MapperConver;
import com.treetao.union.db.model.MallPComment;

/**
 * <p>
 * 商品评论 Mapper 接口
 * </p>
 *
 * @author Dev.M
 * @since 2020-04-11
 */
public interface MallPCommentMapper extends BaseMapper<MallPComment> {
	@Select("select * from mall_p_comment ${ew.customSqlSegment}")
	@Results(id = "commentMap", value = {
			@Result(property = "user", column = "user_id", one = @One(select = MapperConver.CommonUserMapper_selectById)) })//关联查出user信息
	public IPage<MallPComment> custPageData(Page<?> page, @Param(Constants.WRAPPER) QueryWrapper<?> wrapper);
}
